<?php
/**
 * Created by PhpStorm.
 * User: windows10
 * Date: 2020/4/7
 * Time: 23:32
 */

require '../../vendor/autoload.php';
use phpspider\core\phpspider;
use phpspider\core\requests;    //请求类
use phpspider\core\selector;    //选择器类
use phpspider\core\db;    //选择器类
use phpspider\core\log;    //选择器类

// 模拟登陆
$cookies = "md_session_id=20200416000692425; user_refers=a%3A2%3A%7Bi%3A0%3Bs%3A6%3A%22ibaotu%22%3Bi%3A1%3Bs%3A6%3A%22ibaotu%22%3B%7D; md_session_expire=1800; FIRSTVISITED=1587000461.399; head_31931246=%2F%2Fpic.ibaotu.com%2Fhead%2Fdefault.png; ISREQUEST=1; bt_guid=9332847323dd955ac01ebb903493bec5; hide_download_bully_time=1; hide_bully_time=1; referer=http%3A%2F%2Fibaotu.com%2F%3Fm%3Dstats%26callback%3DjQuery1124024950565026765936_1587004321031%26lx%3D1%26pagelx%3D11%26exectime%3D0.0001%26loadtime%3D2.153%26_%3D1587004321033; sign=WEIXIN; login_type=WEIXIN; auth_id=31760267%7C%E6%B3%BD%E9%9B%B2%7C1588300419%7C00ea22da559e8a35a15e2070a954582c; sns=%7B%22type%22%3A%22weixin%22%2C%22token%22%3A%7B%22access_token%22%3A%2232_CxnIli2zFkO7b593fYW8fWjIT4sH5496RRXLbGBQ6k1S_7MDRwGihfqMIfJTvnp6F-chJC6i1_c-8ykbC19Ij7q4KKYd2SS0pnXBb7dnCYU%22%2C%22expires_in%22%3A7200%2C%22refresh_token%22%3A%2232_aQnHvzf4166aW5uuZG9oa60sT9_7GEvjLXbsVWGrUc2eFA8QNo0okai3ygzQ0FpGG0DgOHXVCKsTh4olw451H7Jm-tp8njcF7orEpjdeHL0%22%2C%22openid%22%3A%22oMdYSv0poIkEnyzhJB3cJSP5w_y0%22%2C%22scope%22%3A%22snsapi_login%22%2C%22unionid%22%3A%22oZ_uiwdqySCWyYmE0Vk_cQPf3NPw%22%7D%7D; head_31760267=%2F%2Fthirdwx.qlogo.cn%2Fmmopen%2Fvi_32%2FZ5Ov8ia5Q7iaHtGLDnlUKgic9TdiaogQ6jG6c54yWUhnQ4JrQA9IVGJOyqRwVuBw8S2jwBxbFruTTNJ9xIOK01Mlmg%2F132; Hm_lvt_2b0a2664b82723809b19b4de393dde93=1587000460,1587004421; sign=null; WEBPARAMS=is_pay=1; Hm_lvt_4df399c02bb6b34a5681f739d57787ee=1587000461,1587004421; Hm_lpvt_2b0a2664b82723809b19b4de393dde93=1587004451; Hm_lpvt_4df399c02bb6b34a5681f739d57787ee=1587004451";
requests::set_cookies($cookies, 'ibaotu.com');

//
//
$html = requests::get("https://ibaotu.com/?m=home");
$data = selector::select($html, '//*[@class="user-body-left"]');
echo  111;
//echo json_encode($data);
//file_put_contents('./ithua.txt',var_export($data,true).PHP_EOL,8);




